home *** CD-ROM | disk | FTP | other *** search
- property pSpider, spriteNum, pTimeout, pDirection
-
- on beginSprite me
- pSpider = sprite(spriteNum)
- pDirection = -1
- pTimeout = timeout("spider3").new(25, #crawl, me)
- pSpider.flipH = 0
- end
-
- on crawl me
- pSpider.locH = pSpider.locH + pDirection
- if (pSpider.locH > ((the stage).rect.width + pSpider.width)) or (pSpider.locH < (0 - pSpider.width)) then
- pDirection = pDirection * -1
- the randomSeed = the ticks
- pSpider.locH = random((the stage).rect.width)
- pSpider.flipH = not pSpider.flipH
- if pSpider.locH > (the stage).rect.width then
- pSpider.locH = (the stage).rect.width - 10
- else
- pSpider.locH = 0 + 10
- end if
- end if
- end
-